
//SET DIRECTORY FIRST
*cd " "
use "Vincent&Mango_DataFile1.dta" , clear // ---> See File "Vincent&Mango_DataFile1_Sources" for data data sources, collection, and treatment

//DECLARE PANEL DATA
encode ccode , gen(ncountry)
xtset ncountry year , yearly

********************************************* ROBUSTENESS CHECK ******************************************************


//1) Using Pairwise
set more off
*Short Model
xtpcse rp sng_pc_usr cg_pc_usr gdp_pc_usr , correlation(ar1) pairwise replace
eststo pcse_short_p
*Long Model
xtpcse rp sng_pc_usr cg_pc_usr gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , correlation(ar1) pairwise 
eststo pcse_long_p
esttab pcse_short_p pcse_long_p , mti ( Short(P) Long(P) ) star ( * 0.1 ** 0.05 *** 0.01 ) r2


//2) using variables relative to %GDP
set more off
*Short Model
xtpcse rp sng_gdp cg_gdp gdp_pc_usr , correlation(ar1) replace
eststo ctrl_short
*Long Model
xtpcse rp sng_gdp cg_gdp gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , correlation(ar1)
eststo ctrl_long
*Long Model without BEL
xtpcse rp sng_gdp cg_gdp gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd if ccode != "BEL" , correlation(ar1) // Removing outlier country, Belgium
eststo ctrl_longb
*Log
xtpcse rp ln_sng_gdp ln_cg_gdp gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd  , correlation(ar1) 
eststo ctrl_longl
*Quadratic
xtpcse rp sng_gdp2 sng_gdp cg_gdp gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd  , correlation(ar1)
eststo ctrl_longq
esttab ctrl_short ctrl_long ctrl_longb ctrl_longl ctrl_longq , mti ( Short Long LongB Log Quadratic ) star ( * 0.1 ** 0.05 *** 0.01 ) r2


//3) Selecting either SNG or CG
set more off
*Short Model -- SNG
xtpcse rp sng_pc_usr gdp_pc_usr , correlation(ar1) replace
eststo ctr3_short
*Long Model -- SNG 
xtpcse rp sng_pc_usr gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , correlation(ar1)
eststo ctr3_long
*Short Model -- CG
xtpcse rp cg_pc_usr gdp_pc_usr , correlation(ar1) replace
eststo ctr3_shortc
*Long Model -- CG
xtpcse rp cg_pc_usr gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , correlation(ar1)
eststo ctr3_longc
esttab ctr3_short ctr3_long ctr3_shortc ctr3_longc , mti ( Short_SNG Long_SNG Short_CG Long_CG  ) star ( * 0.1 ** 0.05 *** 0.01 ) r2


//4) RR and REN
set more off
*NOT RR AND REN
xtpcse rp sng_gdp cg_pc_usr gdp_pc_usr serv_gdp pop_den etax randd , correlation(ar1)
eststo ctr4_exp
*NOT EXP
xtpcse rp gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , correlation(ar1)
eststo ctr4_rren
esttab ctr4_exp ctr4_rren , mti ( EXP RREN ) star ( * 0.1 ** 0.05 *** 0.01 ) r2


//5) Driscoll and Kraay (Spatial Correlation Consistent)
set more off
*Short Model
xtscc rp sng_pc_usr cg_pc_usr gdp_pc_usr ,  replace
eststo scc_short
*Long Model
xtscc  rp sng_pc_usr cg_pc_usr gdp_pc_usr rr ren_tot serv_gdp pop_den etax randd , 
eststo scc_long
esttab scc_short scc_long , mti ( Short Long ) star ( * 0.1 ** 0.05 *** 0.01 ) r2


